package wjw.mapper;

import com.wjw.mapper.RoadwayTableMapper;
import com.wjw.model.Roadway_table;
import com.wjw.utils.GetSqlSessionUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class RoadwayTable {

    private SqlSession sqlsession= GetSqlSessionUtils.getSqlSession();
    private RoadwayTableMapper mapper=sqlsession.getMapper(RoadwayTableMapper.class);


    @Test
    public void test11(){
        System.out.println(mapper);
    }
    @Test
    public void test01(){
        List<Roadway_table> all = mapper.findAll();
        System.out.println(all);
    }

    @Test
    public void test02(){
        Roadway_table roadway_table = new Roadway_table();
        roadway_table.setRoad_basic_id(1);
        roadway_table.setRoad_type_id(1);
        roadway_table.setRoadway_thick(2.3);
        roadway_table.setRoadway_type("基层类型1");
        roadway_table.setRoadway_thickness(2.3);
        roadway_table.setRoadway_lans_number(1);
        roadway_table.setRoadway_direction("通行方向1");
        roadway_table.setRoadway_width_range(2.3);
        roadway_table.setRoadway_left_width_range(2.3);
        roadway_table.setRoadway_right_width_range(2.3);
        roadway_table.setRoadway_area(2.3);
        roadway_table.setRoadway_bus(1);
        roadway_table.setRoadway_sidestone_type("侧石类型1");
        roadway_table.setRoadway_sidestone_length(2.3);
        roadway_table.setRoadway_flatstone_type("平石类型1");
        roadway_table.setRoadway_flatstone_length(2.3);
        roadway_table.setRoadway_type_id(1);
        mapper.add(roadway_table);
        sqlsession.commit();
    }

    @Test
    public void test03(){
        Roadway_table roadway_table = new Roadway_table();
        roadway_table.setRoad_basic_id(1);
        roadway_table.setRoad_type_id(2);
        roadway_table.setRoadway_thick(2.3);
        roadway_table.setRoadway_type("基层类型2");
        roadway_table.setRoadway_thickness(2.3);
        roadway_table.setRoadway_lans_number(1);
        roadway_table.setRoadway_direction("通行方向2");
        roadway_table.setRoadway_width_range(2.3);
        roadway_table.setRoadway_left_width_range(2.3);
        roadway_table.setRoadway_right_width_range(2.3);
        roadway_table.setRoadway_area(2.3);
        roadway_table.setRoadway_bus(1);
        roadway_table.setRoadway_sidestone_type("侧石类型2");
        roadway_table.setRoadway_sidestone_length(2.3);
        roadway_table.setRoadway_flatstone_type("平石类型2");
        roadway_table.setRoadway_flatstone_length(2.3);
        roadway_table.setRoadway_type_id(1);
        roadway_table.setRoadway_id(3);
        mapper.change(roadway_table);
        sqlsession.commit();
    }
}
